package Exercise;

import java.text.ParseException;
import java.util.Arrays;

public class SortTest {

    public static void main(String[] args) throws ParseException {
        int[] arr = {1, 332, 43, 25, 3324, 34, 335, 4, 45, 2, 43, 52, 54};

        int num = 0;
        for (int i = 0; i < arr.length - 1; i++) {
            boolean res = true;
            for (int i1 = 0; i1 < arr.length - 1 - i; i1++) {
                if (arr[i1] > arr[i1 + 1]) {
                    num = arr[i1];
                    arr[i1] = arr[i1 + 1];
                    arr[i1 + 1] = num;
                    res = false;
                }
            }

            if (res) {

                return;
            }

        }
        System.out.println(Arrays.toString(arr));
    }
}
